//
//  HHForeachAndScrollview.swift
//  HHSwiftuiPractice
//
//  Created by HongMac on 2023/10/3.
//

import SwiftUI

struct HHForeachAndScrollview: View {
    var body: some View {
        ScrollView(){
            VStack{
                ForEach(0..<10){ index in
                    
                    ScrollView(.horizontal,showsIndicators: false){
                        HStack{
                            ForEach(0..<10){ index in
                                RoundedRectangle(cornerRadius: 25, style: .circular)
                                    .fill(
                                        Color(red: Double.random(in: 0..<1), green: Double.random(in: 0..<1), blue: Double.random(in: 0..<1)))
                                    .frame(width: 200,height: 180)
                                    .shadow(radius: 10)
                                    .padding()

                                    
                            }
                        }
                       
                    }
                    
                }
            }
        }
    }
}

struct HHForeachAndScrollview_Previews: PreviewProvider {
    static var previews: some View {
        HHForeachAndScrollview()
    }
}
